PROGRAM_FILENAME = test3
PROGRAM_CATALOGUE = assembler
PROGRAM = ${PROGRAM_FILENAME}.s
PROGRAM_ELF = ${PROGRAM_FILENAME}.elf
PROGRAM_BIN = file_code.bin
PROGRAM_OBJ = ${PROGRAM_FILENAME}.o
PROGRAM_LST = ${PROGRAM_FILENAME}.lst

DATA_FILENAME = data
DATA = ${DATA_FILENAME}.s
DATA_ELF = ${DATA_FILENAME}.elf
DATA_BIN = file_data.bin
DATA_OBJ = ${DATA_FILENAME}.o
DATA_LST = ${DATA_FILENAME}.lst

AVR_AS = avr-as
AVR_AS_FLAGS = 

AVR_GCC = 
AVR_GCC_FLAGS = 


all: progr


program:
	avr-as -mmcu=atmega128 ${PROGRAM} -o ${PROGRAM_OBJ}
	avr-gcc -mno-interrupts -mno-tablejump -nostartfiles -mmcu=atmega128 ${PROGRAM_OBJ} -o ${PROGRAM_ELF}
	avr-objcopy --output-target binary ${PROGRAM_ELF} ${PROGRAM_BIN}
	avr-objdump -d ${PROGRAM_ELF} > ${PROGRAM_LST}
	cp  ${PROGRAM_BIN} ../projekt_uC_AVR/
	

data:	
	avr-as -mmcu=atmega128 ${DATA} -o ${DATA_OBJ}
	avr-gcc -mno-interrupts -mno-tablejump -nostartfiles -mmcu=atmega128 ${DATA_OBJ} -o ${DATA_ELF}
	avr-objcopy --output-target binary ${DATA_ELF} ${DATA_BIN}
	avr-objdump -d ${DATA_ELF} > ${DATA_LST}
	cp  ${DATA_BIN} ../projekt_uC_AVR/
clean:
	rm -f *.o *.elf *.lst *.bin